<html>
<head><meta charset="utf-8"><title>let chains · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let.20chains.html">let chains</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="201247601"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let%20chains/near/201247601" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let.20chains.html#201247601">(Jun 18 2020 at 09:51)</a>:</h4>
<p>Is there anyone currently pushing let-chains forward? <span class="user-mention" data-user-id="124288">@oli</span>, it looks like you were involved - do you know what work is remaining? I'd be interested in picking it up.</p>



<a name="201247664"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let%20chains/near/201247664" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let.20chains.html#201247664">(Jun 18 2020 at 09:52)</a>:</h4>
<p>I was reviewing changes, but I have absolutely no overview of the progress</p>



<a name="201256771"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let%20chains/near/201256771" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let.20chains.html#201256771">(Jun 18 2020 at 11:48)</a>:</h4>
<p>I that the following were what the next steps were:</p>
<ul>
<li>Reintroduce <code>hir::ExprKind::If</code> and also handle in mir lowering</li>
<li>Add <code>hir::ExprKind::Let</code>, mir lowering could be split out here.</li>
</ul>
<p>I think Centril had a branch for <code>ExprKind::Let</code>, but it's a bit messy doing <code>ExprKind::Let</code> before <code>ExprKind::If</code>.</p>



<a name="201256892"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let%20chains/near/201256892" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let.20chains.html#201256892">(Jun 18 2020 at 11:49)</a>:</h4>
<p>And then at some point: make <code>let expressions + &amp;&amp;</code> lower to MIR that keeps the borrow checker happy.</p>



<a name="201258976"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let%20chains/near/201258976" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let.20chains.html#201258976">(Jun 18 2020 at 12:13)</a>:</h4>
<p>Thanks! I'll familiarize myself with the previous PRs and how things are being lowered currently with that in mind.</p>



<a name="201337118"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let%20chains/near/201337118" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let.20chains.html#201337118">(Jun 18 2020 at 23:16)</a>:</h4>
<p>I would love to see someone pick up and run with <code>let</code> chains. I've found myself wanting them several times lately.</p>



<a name="202045947"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let%20chains/near/202045947" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let.20chains.html#202045947">(Jun 26 2020 at 02:10)</a>:</h4>
<p>kind of funny that we're undoing the <code>if</code> removal (which by itself I guess wasn't that big of a win anyway :P)</p>



<a name="202137481"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let%20chains/near/202137481" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let.20chains.html#202137481">(Jun 26 2020 at 20:16)</a>:</h4>
<p>looking at the PR which simplified the HIR might reduce the work here to copy-paste.</p>



<a name="202146421"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let%20chains/near/202146421" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let.20chains.html#202146421">(Jun 26 2020 at 21:47)</a>:</h4>
<p>I’m going to start digging into this at the weekend now that I’ve gotten on top of other PRs.</p>



<a name="206355441"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let%20chains/near/206355441" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let.20chains.html#206355441">(Aug 08 2020 at 16:55)</a>:</h4>
<p><span class="user-mention" data-user-id="116107">@davidtwco</span> Did you end up picking this up? If not, I'd be interested in working on it</p>



<a name="206355533"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let%20chains/near/206355533" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let.20chains.html#206355533">(Aug 08 2020 at 16:58)</a>:</h4>
<p>I haven’t yet, been meaning to carve out time to dig into it but always ended up doing something else, feel free to take it <span class="user-mention" data-user-id="125294">@Aaron Hill</span></p>



<a name="206358319"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let%20chains/near/206358319" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let.20chains.html#206358319">(Aug 08 2020 at 18:22)</a>:</h4>
<p>It looks like the original RFC described a desugaring in terms of existing language features (labeled break with value). Is that the intended plan for implementing the desugaring, or is that just a way of conceptually understanding the feature?</p>



<a name="206358361"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let%20chains/near/206358361" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let.20chains.html#206358361">(Aug 08 2020 at 18:22)</a>:</h4>
<p>PR <a href="https://github.com/rust-lang/rust/pull/68577">https://github.com/rust-lang/rust/pull/68577</a> seemed to be moving in the direction of not using labeled break at all</p>



<a name="206361604"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let%20chains/near/206361604" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let.20chains.html#206361604">(Aug 08 2020 at 19:50)</a>:</h4>
<p><span class="user-mention" data-user-id="116118">@Matthew Jasper</span> ^</p>



<a name="206363600"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let%20chains/near/206363600" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let.20chains.html#206363600">(Aug 08 2020 at 20:50)</a>:</h4>
<p>Yes, the rfc desugaring gives drop ordering inconsistent with with <code>if ... &amp;&amp; ...</code>. Reintroducing <code>if</code> in HIR and adding a <code>let</code> expression works better (and is easier to extend to general let expressions and/or <code>let else</code>.</p>



<a name="220481318"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let%20chains/near/220481318" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caio <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let.20chains.html#220481318">(Dec 19 2020 at 18:28)</a>:</h4>
<p>Can someone review <a href="https://github.com/rust-lang/rust/pull/79328">https://github.com/rust-lang/rust/pull/79328</a>? I am really stuck with the UI tests and any help would be appreciated</p>



<a name="220481373"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let%20chains/near/220481373" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let.20chains.html#220481373">(Dec 19 2020 at 18:30)</a>:</h4>
<p><span class="user-mention" data-user-id="211466">@Caio</span> what help do you need? all the tests are passing</p>



<a name="220482044"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let%20chains/near/220482044" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caio <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let.20chains.html#220482044">(Dec 19 2020 at 18:49)</a>:</h4>
<p>Two tests were temporary changed to make CI green. The real problem comes down from the fact that some diagnostics disappeared and I couldn't find the root cause of such behaviors, e.g.,  <a href="https://github.com/rust-lang/rust/pull/79328/files#diff-c823c09660f5b112f95e97e8ff71f1797b6c7f37dbb3d16f8e98bbaea8072e95">https://github.com/rust-lang/rust/pull/79328/files#diff-c823c09660f5b112f95e97e8ff71f1797b6c7f37dbb3d16f8e98bbaea8072e95</a>. Another worrisome thing is that MIR output has changed (not sure it was for better or for worse)</p>



<a name="220483057"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let%20chains/near/220483057" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caio <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let.20chains.html#220483057">(Dec 19 2020 at 19:16)</a>:</h4>
<p>Ok. Just found out that <code>find_all_ret_expressions</code> wasn't visiting <code>hir::ExprKind::If</code> but there are still many tests to fix <span aria-label="rolling eyes" class="emoji emoji-1f644" role="img" title="rolling eyes">:rolling_eyes:</span></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>